GA
action

POTION AJUDA

Por gabrielbuff, 22 de fev. de 2016 em Scripts

potion vocacao
4
1k
gabrielbuffG
22 de fevereiro de 2016 às 00:52

Alguem poderia me ajudar.. Não consigo fazer a vocation nova do meu servidor a usar potion(ultimate health potion), Vocation nova ( Titan Gladiator) voc id="12"

 

script potion

 

local MIN = 900
local MAX = 1100
local EMPTY_POTION = 7635

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end

if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end

if((not(isKnight(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 130) and getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) then
doCreatureSay(itemEx.uid, "Only knights of level 130 or above may drink this fluid.", TALKTYPE_ORANGE_1)
return TRUE
end

if doCreatureAddHealth(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
return FALSE
end

doAddCondition(cid, exhaust)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_RED)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
return TRUE
end

FurabioF
22 de fevereiro de 2016 às 09:28


local MIN = 900

local MAX = 1100

local EMPTY_POTION = 7635

local exhaust = createConditionObject(CONDITION_EXHAUST)

setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)

if isPlayer(itemEx.uid) == FALSE then

return FALSE

end

if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then

doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)

return TRUE

end

if(not isInArray({4,8,12}, getPlayerVocation(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 130) and getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) then

doCreatureSay(itemEx.uid, "Only knights of level 130 or above may drink this fluid.", TALKTYPE_ORANGE_1)

return TRUE

end

if doCreatureAddHealth(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then

return FALSE

end

doAddCondition(cid, exhaust)

doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_RED)

doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)

return TRUE

end

 

gabrielbuffG
22 de fevereiro de 2016 às 11:26

Kawoszin, não deu certo apareceu seguinte erro.

 

[22/02/2016 11:25:32] [Error - LuaScriptInterface::loadFile] data/actions/scripts/liquids/ultimate_health.lua:14: 'then' expected near ')'
[22/02/2016 11:25:32] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/liquids/ultimate_health.lua)
[22/02/2016 11:25:32] data/actions/scripts/liquids/ultimate_health.lua:14: 'then' expected near ')'

 

 

conseguir arrumar não tinha nada a ver com as potion, era so ir na libs e adicionar a vocation. mais valeu pela ajuda.

Editado Fevereiro 22 por gabrielbuff

CaronteC
22 de fevereiro de 2016 às 11:57

Entre

and getPlayerCustomFlagValue

 

Adicione um parêntesis

and (getPlayerCustomFlagValue